home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / Replacements / cpdist_0_17.lha / cpdist-0.17 / source / Makefile < prev    next >
Makefile  |  1994-06-03  |  3KB  |  110 lines

  1. # CPDIST -*- Makefile -*- for the GNU C/C++ Compiler on unix systems
  2. #
  3. # (c)Copyright 1992-93 by Tobias Ferber.
  4. #
  5. # This file is part of CPDIST.
  6. #
  7. # CPDIST is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published
  9. # by the Free Software Foundation; either version 1 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # CPDIST is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with CPDIST; see the file COPYING.  If not, write to
  19. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. SHELL= /bin/sh
  22. RM= rm -f
  23.  
  24. CC=gcc
  25. #CC= cc
  26.  
  27. # -DNO_GETKEY   use gets() instead of device dependent getkey()
  28. # -DNO_PERROR   don't use perror()
  29.  
  30. # I used this under Linux
  31. CFLAGS= -O2 -Wall -DNO_GETKEY -DNO_SHORTHAND_TYPES
  32.  
  33. # DEC Alpha
  34. #CFLAGS= -O2 -Wall -DNO_GETKEY
  35. #CFLAGS= -D__STDC__
  36.  
  37. # CPDIST will compile w/o Amiga dependent material (amiga.lib & includes)
  38. # if   cpdist.c    is compiled w/  -DNO_GETKEY
  39. # and  filecopy.c  is compiled w/o -UAMIGA
  40.  
  41. # getkey() needs libcurses.a and libtermlib.a on unix machines
  42. LIBS=
  43. #LIBS= -L/usr/lib -lcurses -ltermlib
  44.  
  45. # *** / CPDIST / ***
  46.  
  47. .PHONY: all
  48.  
  49. all: cpdist
  50.  
  51. #add getkey.o to the rhs if compiled w/o -DNO_GETKEY
  52. #cpdist: main.o args.o msg.o cpdist.o keys.o filecopy.o getkey.o
  53. cpdist: main.o args.o msg.o cpdist.o keys.o filecopy.o
  54.     $(CC) $(CFLAGS) -o $@ $? $(LIBS)
  55.  
  56. main.o: main.c cpdist.h
  57.     $(CC) $(CFLAGS) -c -o $@ $<
  58.  
  59. args.o: args.c
  60.     $(CC) $(CFLAGS) -c -o $@ $<
  61.  
  62. msg.o: msg.c cpdist.h
  63.     $(CC) $(CFLAGS) -c -o $@ $<
  64.  
  65. cpdist.o: cpdist.c cpdist.h
  66.     $(CC) $(CFLAGS) -c -o $@ $<
  67. #    $(CC) $(CFLAGS) -DNO_GETKEY -c -o $@ $<
  68.  
  69. keys.o: keys.c cpdist.h
  70.     $(CC) $(CFLAGS) -c -o $@ $<
  71. #    $(CC) $(CFLAGS) -DNO_GETKEY -c -o $@ $<
  72.  
  73. getkey.o: getkey.c getkey.h
  74.     $(CC) $(CFLAGS) -c -o $@ $<
  75.  
  76. #use -UAMIGA to use c.lib's malloc() instead of exec.library's AllocMem()
  77. filecopy.o: filecopy.c filecopy.h
  78.     $(CC) $(CFLAGS) -UAMIGA -c -o $@ $<
  79.  
  80.  
  81. # *** / GETKEY / ***
  82.  
  83. getkey: getkey.c getkey.h
  84.     $(CC) $(CFLAGS) -DTEST -o $@ $< $(LIBS)
  85.  
  86.  
  87. # *** / CLEAN / ***
  88.  
  89. .PHONY: clean
  90.  
  91. clean:
  92.     ifneq ($(strip $(wildcard *.o cpdist getkey)),)
  93.       $(RM) $(wildcard *.o cpdist getkey)
  94.     endif
  95.  
  96.  
  97. # *** / DEPEND / ***
  98.  
  99. .PHONY: depend
  100.  
  101. depend:
  102.     $(CC) -MM $(CFLAGS) *.c > .depend
  103.  
  104.  
  105. #include the dependency file (if it exists)
  106.  
  107. ifeq (.depend,$(wildcard .depend))
  108. include .depend
  109. endif
  110.